<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.7.2/axios.js"></script>
</head>

<body>
    <!-- 提交数据 -->
    <!--
        上传文件时属性设置  enctype="multipart/form-data"
    -->
    <form action="http://127.0.0.1:3000/users" method="POST" enctype="multipart/form-data">
        用户名：<input type="text" name="username" /><br />
        密码：<input type="password" name="password" /><br />
        <!-- 多文件上传 multiple-->
        文件：<input type="file" name="files" multiple /><br />
        <input type="submit" />
    </form>
    <button id="getReq">请求按钮</button>
    <script>
        let obtn = document.getElementById("getReq")
        obtn.onclick = function () {
            // 启动本地5500端口 直接请求报错问题 跨域了 请求中配置跨域中间件 cors
            fetch("http://127.0.0.1:3000/download/cache")
            // axios.get("http://127.0.0.1:3000/download/cache")
                .then(res => {
                    console.log(res)
                })
                .catch(err => {
                    console.log(err)
                })
        }
    </script>
</body>

</html>